<?php 
include_once "../common/basic.php";
include_once "auto.class.php";
$auto = new auto($config,$db,$log);

if(isset($_GET[brand_id])){
	$brand = $auto->brand_query($_GET[brand_id]);
	$series_arr = $auto->series_query($_GET[brand_id]);
	if(count($series_arr)>0){
		foreach($series_arr as $idx=>$series){
			$car_arr = $auto->cars_query($series[id]);
			$series_arr[$idx][cars]=$car_arr;
			foreach($car_arr as $idx2=>$car){
				$series_arr[$idx][cars][$idx2][price]=$auto->car_price($car[id]);
			}
		}
	}
}
$tl->set_file("cars");
$tl->p();
?>